package com.spgf.control.models;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.archtecture.control.models.ModelAb;
import com.archtecture.control.models.Usuario;

/**
 * The persistent class for the lancamento database table.
 * 
 */
@Entity
@Table(name = "lancamento")
public class Lancamento extends ModelAb implements Serializable {

	/**
	 * 
	 */
	private static final long	serialVersionUID	= 7745788260607919104L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "CODIGO")
	private Integer				codigo;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DATA")
	private Date				data;

	@Column(name = "OBSERVACAO")
	private String				observacao;

	@Column(name = "VALOR")
	private Double				valor;

	// bi-directional many-to-one association to Banco
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "CODIGO_BANCO")
	private Banco				banco;

	// bi-directional many-to-one association to Categoria
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "CODIGO_CATEGORIA")
	private Categoria			categoria;

	// bi-directional many-to-one association to Usuario
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "CODIGO_USUARIO")
	private Usuario				usuario;

	@Override
	public String[] getAtributosOrdencao() {
		return new String[] {"data", "codigo"};
	}

	/**
	 * @return the banco
	 */
	public Banco getBanco() {
		return banco;
	}

	/**
	 * @return the categoria
	 */
	public Categoria getCategoria() {
		return categoria;
	}

	@Override
	public Integer getCodigo() {
		return codigo;
	}

	/**
	 * @return the data
	 */
	public Date getData() {
		return data;
	}

	/**
	 * @return the observacao
	 */
	public String getObservacao() {
		return observacao;
	}

	/**
	 * @return the usuario
	 */
	public Usuario getUsuario() {
		return usuario;
	}

	/**
	 * @return the valor
	 */
	public Double getValor() {
		return valor;
	}

	/**
	 * @param banco
	 *            the banco to set
	 */
	public void setBanco(Banco banco) {
		this.banco = banco;
	}

	/**
	 * @param categoria
	 *            the categoria to set
	 */
	public void setCategoria(Categoria categoria) {
		this.categoria = categoria;
	}

	public void setCodigo(Integer codigo) {
		this.codigo = codigo;
	}

	/**
	 * @param data
	 *            the data to set
	 */
	public void setData(Date data) {
		this.data = data;
	}

	/**
	 * @param observacao
	 *            the observacao to set
	 */
	public void setObservacao(String observacao) {
		this.observacao = observacao;
	}

	/**
	 * @param usuario
	 *            the usuario to set
	 */
	public void setUsuario(Usuario usuario) {
		this.usuario = usuario;
	}

	/**
	 * @param valor
	 *            the valor to set
	 */
	public void setValor(Double valor) {
		this.valor = valor;
	}

}